# Manipulación de estructuras
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.0 --
## v ggplot2 3.3.3 v purrr 0.3.4
## v tibble 3.1.0 v dplyr 1.0.5
## v tidyr 1.1.3 v stringr 1.4.0
## v readr 1.4.0 v forcats 0.5.1
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(dplyr)
library(tidyr)
# Para realizar plots
#library(scatterplot3d)
library(ggplot2)
# library(plotly)
random.abb = read.table("Resultados/aleatorioAbb.txt")
random.avl = read.table("Resultados/aleatorioAvl.txt")
random.splay = read.table("Resultados/aleatorioSplay.txt")
random.btree16 = read.table("Resultados/aleatorioBtree16.txt")
random.btree256 = read.table("Resultados/aleatorioBtree256.txt")
random.btree4096 = read.table("Resultados/aleatorioBtree4096.txt")
Experimento_aleatorio <- data.frame(Operacion = integer(),
V1 = double(),
Estructura = factor())
z <- data.frame(Operacion = c(1:1000), V1 = random.abb, Estructura = "ABB")
Experimento_aleatorio <- rbind(Experimento_aleatorio, z)
z <- data.frame(Operacion = c(1:1000), V1 = random.avl, Estructura = "AVL")
Experimento_aleatorio <- rbind(Experimento_aleatorio, z)
z <- data.frame(Operacion = c(1:1000), V1 = random.splay, Estructura = "Splay")
Experimento_aleatorio <- rbind(Experimento_aleatorio, z)
z <- data.frame(Operacion = c(1:1000), V1 = random.btree16, Estructura = "BTree16")
Experimento_aleatorio <- rbind(Experimento_aleatorio, z)
z <- data.frame(Operacion = c(1:1000), V1 = random.btree256, Estructura = "BTree256")
Experimento_aleatorio <- rbind(Experimento_aleatorio, z)
z <- data.frame(Operacion = c(1:1000), V1 = random.btree4096, Estructura = "BTree4096")
Experimento_aleatorio <- rbind(Experimento_aleatorio, z)
summary(Experimento_aleatorio)
## Operacion V1 Estructura
## Min. : 1.0 Min. :0.0001490 Length:6000
## 1st Qu.: 250.8 1st Qu.:0.0005940 Class :character
## Median : 500.5 Median :0.0009835 Mode :character
## Mean : 500.5 Mean :0.0017397
## 3rd Qu.: 750.2 3rd Qu.:0.0017060
## Max. :1000.0 Max. :0.0115030
plot <- ggplot(data = Experimento_aleatorio, aes(x=Estructura, y=V1, color=Estructura)) +
geom_boxplot() +
xlab("Estructuras") +
ylab("Tiempo [s]") +
ggtitle("Boxplot por cada estructura\nExperimento aleatorio") +
theme(plot.title = element_text(hjust = 0.5))
plot
plot <- ggplot(data = Experimento_aleatorio, aes(x=Operacion, y=V1), inherit.aes = FALSE) +
geom_line(aes(colour=Estructura)) +
xlab("Promedios de cada segmento de iteraciones") +
ylab("Tiempo [s]") +
ggtitle("Tiempo por cada segmento de operaciones\nExperimento aleatorio") +
theme(plot.title = element_text(hjust = 0.5))
plot
creciente01.abb = read.table("Resultados/creciente0p1Abb.txt")
creciente01.avl = read.table("Resultados/creciente0p1Avl.txt")
creciente01.splay = read.table("Resultados/creciente0p1Splay.txt")
creciente01.btree16 = read.table("Resultados/creciente0p1Btree16.txt")
creciente01.btree256 = read.table("Resultados/creciente0p1Btree256.txt")
creciente01.btree4096 = read.table("Resultados/creciente0p1Btree4096.txt")
Experimento_creciente0p1 <- data.frame(Operacion = integer(),
V1 = double(),
Estructura = factor())
z <- data.frame(Operacion = c(1:1000), V1 = creciente01.abb, Estructura = "ABB")
Experimento_creciente0p1 <- rbind(Experimento_creciente0p1, z)
z <- data.frame(Operacion = c(1:1000), V1 = creciente01.avl, Estructura = "AVL")
Experimento_creciente0p1 <- rbind(Experimento_creciente0p1, z)
z <- data.frame(Operacion = c(1:1000), V1 = creciente01.splay, Estructura = "Splay")
Experimento_creciente0p1 <- rbind(Experimento_creciente0p1, z)
z <- data.frame(Operacion = c(1:1000), V1 = creciente01.btree16, Estructura = "BTree16")
Experimento_creciente0p1 <- rbind(Experimento_creciente0p1, z)
z <- data.frame(Operacion = c(1:1000), V1 = creciente01.btree256, Estructura = "BTree256")
Experimento_creciente0p1 <- rbind(Experimento_creciente0p1, z)
z <- data.frame(Operacion = c(1:1000), V1 = creciente01.btree4096, Estructura = "BTree4096")
Experimento_creciente0p1 <- rbind(Experimento_creciente0p1, z)
summary(Experimento_creciente0p1)
## Operacion V1 Estructura
## Min. : 1.0 Min. :0.000126 Length:6000
## 1st Qu.: 250.8 1st Qu.:0.000584 Class :character
## Median : 500.5 Median :0.000994 Mode :character
## Mean : 500.5 Mean :0.019035
## 3rd Qu.: 750.2 3rd Qu.:0.005672
## Max. :1000.0 Max. :0.505075
plot <- ggplot(data = Experimento_creciente0p1, aes(x=Operacion, y=V1), inherit.aes = FALSE) +
geom_line(aes(colour=Estructura)) +
xlab("Promedios de cada segmento de iteraciones") +
ylab("Tiempo [s]") +
ggtitle("Tiempo por cada segmento de operaciones\nExperimento Creciente k=0.1") +
theme(plot.title = element_text(hjust = 0.5))
plot
creciente05.abb = read.table("Resultados/creciente0p5Abb.txt")
creciente05.avl = read.table("Resultados/creciente0p5Avl.txt")
creciente05.splay = read.table("Resultados/creciente0p5Splay.txt")
creciente05.btree16 = read.table("Resultados/creciente0p5Btree16.txt")
creciente05.btree256 = read.table("Resultados/creciente0p5Btree256.txt")
creciente05.btree4096 = read.table("Resultados/creciente0p5Btree4096.txt")
Experimento_creciente0p5 <- data.frame(Operacion = integer(),
V1 = double(),
Estructura = factor())
z <- data.frame(Operacion = c(1:1000), V1 = creciente05.abb, Estructura = "ABB")
Experimento_creciente0p5 <- rbind(Experimento_creciente0p5, z)
z <- data.frame(Operacion = c(1:1000), V1 = creciente05.avl, Estructura = "AVL")
Experimento_creciente0p5 <- rbind(Experimento_creciente0p5, z)
z <- data.frame(Operacion = c(1:1000), V1 = creciente05.splay, Estructura = "Splay")
Experimento_creciente0p5 <- rbind(Experimento_creciente0p5, z)
z <- data.frame(Operacion = c(1:1000), V1 = creciente05.btree16, Estructura = "BTree16")
Experimento_creciente0p5 <- rbind(Experimento_creciente0p5, z)
z <- data.frame(Operacion = c(1:1000), V1 = creciente05.btree256, Estructura = "BTree256")
Experimento_creciente0p5 <- rbind(Experimento_creciente0p5, z)
z <- data.frame(Operacion = c(1:1000), V1 = creciente05.btree4096, Estructura = "BTree4096")
Experimento_creciente0p5 <- rbind(Experimento_creciente0p5, z)
summary(Experimento_creciente0p5)
## Operacion V1 Estructura
## Min. : 1.0 Min. :0.000128 Length:6000
## 1st Qu.: 250.8 1st Qu.:0.000586 Class :character
## Median : 500.5 Median :0.001159 Mode :character
## Mean : 500.5 Mean :0.008650
## 3rd Qu.: 750.2 3rd Qu.:0.005652
## Max. :1000.0 Max. :0.106486
plot <- ggplot(data = Experimento_creciente0p5, aes(x=Operacion, y=V1), inherit.aes = FALSE) +
geom_line(aes(colour=Estructura)) +
xlab("Promedios de cada segmento de iteraciones") +
ylab("Tiempo [s]") +
ggtitle("Tiempo por cada segmento de operaciones\nExperimento Creciente k=0.5") +
theme(plot.title = element_text(hjust = 0.5))
plot
sesgadox.abb = read.table("Resultados/sesgadoxAbb.txt")
sesgadox.avl = read.table("Resultados/sesgadoxAvl.txt")
sesgadox.splay = read.table("Resultados/sesgadoxSplay.txt")
sesgadox.btree16 = read.table("Resultados/sesgadoxBtree16.txt")
sesgadox.btree256 = read.table("Resultados/sesgadoxBtree256.txt")
sesgadox.btree4096 = read.table("Resultados/sesgadoxBtree4096.txt")
Experimento_sesgadox <- data.frame(Operacion = integer(),
V1 = double(),
Estructura = factor())
z <- data.frame(Operacion = c(1:1000), V1 = sesgadox.abb, Estructura = "ABB")
Experimento_sesgadox <- rbind(Experimento_sesgadox, z)
z <- data.frame(Operacion = c(1:1000), V1 = sesgadox.avl, Estructura = "AVL")
Experimento_sesgadox <- rbind(Experimento_sesgadox, z)
z <- data.frame(Operacion = c(1:1000), V1 = sesgadox.splay, Estructura = "Splay")
Experimento_sesgadox <- rbind(Experimento_sesgadox, z)
z <- data.frame(Operacion = c(1:1000), V1 = sesgadox.btree16, Estructura = "BTree16")
Experimento_sesgadox <- rbind(Experimento_sesgadox, z)
z <- data.frame(Operacion = c(1:1000), V1 = sesgadox.btree256, Estructura = "BTree256")
Experimento_sesgadox <- rbind(Experimento_sesgadox, z)
z <- data.frame(Operacion = c(1:1000), V1 = sesgadox.btree4096, Estructura = "BTree4096")
Experimento_sesgadox <- rbind(Experimento_sesgadox, z)
summary(Experimento_sesgadox)
## Operacion V1 Estructura
## Min. : 1.0 Min. :0.000131 Length:6000
## 1st Qu.: 250.8 1st Qu.:0.000563 Class :character
## Median : 500.5 Median :0.001027 Mode :character
## Mean : 500.5 Mean :0.001775
## 3rd Qu.: 750.2 3rd Qu.:0.001765
## Max. :1000.0 Max. :0.029734
plot <- ggplot(data = Experimento_sesgadox, aes(x=Estructura, y=V1, color=Estructura)) +
geom_boxplot() +
xlab("Estructuras") +
ylab("Tiempo [s]") +
ggtitle("Boxplot por cada estructura\nExperimento Sesgado f(x) = x") +
theme(plot.title = element_text(hjust = 0.5))
plot
plot <- ggplot(data = Experimento_sesgadox, aes(x=Operacion, y=V1), inherit.aes = FALSE) +
geom_line(aes(colour=Estructura)) +
xlab("Promedios de cada segmento de iteraciones") +
ylab("Tiempo [s]") +
ggtitle("Tiempo por cada segmento de operaciones\nExperimento Sesgado f(x) = x") +
theme(plot.title = element_text(hjust = 0.5))
plot
sesgadosqrt.abb = read.table("Resultados/sesgadosqrtAbb.txt")
sesgadosqrt.avl = read.table("Resultados/sesgadosqrtAvl.txt")
sesgadosqrt.splay = read.table("Resultados/sesgadosqrtSplay.txt")
sesgadosqrt.btree16 = read.table("Resultados/sesgadosqrtBtree16.txt")
sesgadosqrt.btree256 = read.table("Resultados/sesgadosqrtBtree256.txt")
sesgadosqrt.btree4096 = read.table("Resultados/sesgadosqrtBtree4096.txt")
Experimento_sesgadosqrt <- data.frame(Operacion = integer(),
V1 = double(),
Estructura = factor())
z <- data.frame(Operacion = c(1:1000), V1 = sesgadosqrt.abb, Estructura = "ABB")
Experimento_sesgadosqrt <- rbind(Experimento_sesgadosqrt, z)
z <- data.frame(Operacion = c(1:1000), V1 = sesgadosqrt.avl, Estructura = "AVL")
Experimento_sesgadosqrt <- rbind(Experimento_sesgadosqrt, z)
z <- data.frame(Operacion = c(1:1000), V1 = sesgadosqrt.splay, Estructura = "Splay")
Experimento_sesgadosqrt <- rbind(Experimento_sesgadosqrt, z)
z <- data.frame(Operacion = c(1:1000), V1 = sesgadosqrt.btree16, Estructura = "BTree16")
Experimento_sesgadosqrt <- rbind(Experimento_sesgadosqrt, z)
z <- data.frame(Operacion = c(1:1000), V1 = sesgadosqrt.btree256, Estructura = "BTree256")
Experimento_sesgadosqrt <- rbind(Experimento_sesgadosqrt, z)
z <- data.frame(Operacion = c(1:1000), V1 = sesgadosqrt.btree4096, Estructura = "BTree4096")
Experimento_sesgadosqrt <- rbind(Experimento_sesgadosqrt, z)
summary(Experimento_sesgadosqrt)
## Operacion V1 Estructura
## Min. : 1.0 Min. :0.0001450 Length:6000
## 1st Qu.: 250.8 1st Qu.:0.0006038 Class :character
## Median : 500.5 Median :0.0010190 Mode :character
## Mean : 500.5 Mean :0.0018180
## 3rd Qu.: 750.2 3rd Qu.:0.0018388
## Max. :1000.0 Max. :0.0227980
plot <- ggplot(data = Experimento_sesgadosqrt, aes(x=Estructura, y=V1, color=Estructura)) +
geom_boxplot() +
xlab("Estructuras") +
ylab("Tiempo [s]") +
ggtitle("Boxplot por cada estructura\nExperimento Sesgado f(x)=sqrt(x)") +
theme(plot.title = element_text(hjust = 0.5))
plot
plot <- ggplot(data = Experimento_sesgadosqrt, aes(x=Operacion, y=V1), inherit.aes = FALSE) +
geom_line(aes(colour=Estructura)) +
xlab("Promedios de cada segmento de iteraciones") +
ylab("Tiempo [s]") +
ggtitle("Tiempo por cada segmento de operaciones\nExperimento Sesgado f(x)=sqrt(x)") +
theme(plot.title = element_text(hjust = 0.5))
plot
sesgadoln.abb = read.table("Resultados/sesgadolnAbb.txt")
sesgadoln.avl = read.table("Resultados/sesgadolnAvl.txt")
sesgadoln.splay = read.table("Resultados/sesgadolnSplay.txt")
sesgadoln.btree16 = read.table("Resultados/sesgadolnBtree16.txt")
sesgadoln.btree256 = read.table("Resultados/sesgadolnBtree256.txt")
sesgadoln.btree4096 = read.table("Resultados/sesgadolnBtree4096.txt")
Experimento_sesgadoln <- data.frame(Operacion = integer(),
V1 = double(),
Estructura = factor())
z <- data.frame(Operacion = c(1:1000), V1 = sesgadoln.abb, Estructura = "ABB")
Experimento_sesgadoln <- rbind(Experimento_sesgadoln, z)
z <- data.frame(Operacion = c(1:1000), V1 = sesgadoln.avl, Estructura = "AVL")
Experimento_sesgadoln <- rbind(Experimento_sesgadoln, z)
z <- data.frame(Operacion = c(1:1000), V1 = sesgadoln.splay, Estructura = "Splay")
Experimento_sesgadoln <- rbind(Experimento_sesgadoln, z)
z <- data.frame(Operacion = c(1:1000), V1 = sesgadoln.btree16, Estructura = "BTree16")
Experimento_sesgadoln <- rbind(Experimento_sesgadoln, z)
z <- data.frame(Operacion = c(1:1000), V1 = sesgadoln.btree256, Estructura = "BTree256")
Experimento_sesgadoln <- rbind(Experimento_sesgadoln, z)
z <- data.frame(Operacion = c(1:1000), V1 = sesgadoln.btree4096, Estructura = "BTree4096")
Experimento_sesgadoln <- rbind(Experimento_sesgadoln, z)
summary(Experimento_sesgadoln)
## Operacion V1 Estructura
## Min. : 1.0 Min. :0.000161 Length:6000
## 1st Qu.: 250.8 1st Qu.:0.000574 Class :character
## Median : 500.5 Median :0.001028 Mode :character
## Mean : 500.5 Mean :0.001881
## 3rd Qu.: 750.2 3rd Qu.:0.001784
## Max. :1000.0 Max. :0.014354
plot <- ggplot(data = Experimento_sesgadoln, aes(x=Estructura, y=V1, color=Estructura)) +
geom_boxplot() +
xlab("Estructuras") +
ylab("Tiempo [s]") +
ggtitle("Boxplot por cada estructura\nExperimento Sesgado f(x)=ln(x)") +
theme(plot.title = element_text(hjust = 0.5))
plot
plot <- ggplot(data = Experimento_sesgadoln, aes(x=Operacion, y=V1), inherit.aes = FALSE) +
geom_line(aes(colour=Estructura)) +
xlab("Promedios de cada segmento de iteraciones") +
ylab("Tiempo [s]") +
ggtitle("Tiempo por cada segmento de operaciones\nExperimento Sesgado f(x)=ln(x)") +
theme(plot.title = element_text(hjust = 0.5))
plot
A work by cd